#pragma once
#include <string>
#include "Event/Event.h"
#include "orangepch.h"

namespace Orange
{

    struct WindowProps
    {
        unsigned int m_Width;
        unsigned int m_Height;
        std::string m_Title;
        WindowProps(unsigned int width = 200, unsigned int height = 200, const std::string &title = "Orange") : m_Width(width), m_Height(height), m_Title(title)
        {
        }
    };

    class Window
    {
    public:
        using EventCallback = std::function<void(Event &)>;
        
        virtual ~Window(){};
        virtual const unsigned int GetWidth() const = 0;
        virtual const unsigned int GetHeight() const = 0;
        // 设置垂直同步
        virtual void SetSync(bool enable) = 0;
        virtual const bool IsSync() const = 0;

        // 窗口刷新事件
        virtual void OnUpdate() = 0;

        // 获取当前窗口
        virtual  void *GetNativeWindow() const = 0;

        // 设置回调函数

        virtual void SetCallback(const EventCallback &callback) = 0;
        virtual void ShutDown() = 0;

        static Window *Create(const WindowProps &props = WindowProps());
    };
}